import request from '@/utils/request'

// 查询企业的部门列表
export const getDepartments = () => request({
  url: '/company/department'
})

// 封装根据ID删除部门
export const delDepartments = id => request({
  url: `/company/department/${id}`,
  method: 'DELETE'
})

// 新增部门接口
export const addDepartments = data => request({
  url: '/company/department',
  method: 'POST',
  data
})

// 根据ID查询部门详情
export const getDepartDetail = id => request({
  url: `/company/department/${id}`
})

// 根据ID修改部门详情
export const updateDepartments = data => request({
  url: `/company/department/${data.id}`,
  method: 'PUT',
  data
})
